# -*- coding:UTF-8 -*-
"""
@Project : pythonProject
@File    : Python-M05.py
@IDE     : PyCharm
@Author  : WorldWind(1772830365@qq.com)
@Address : China - HeiLongjiang - Herbin
@Date    : 2025/7/8 下午9:10
"""
# a.统计一段文本中每个字符的出现频率，忽略大小写（输出如 {"a":3, "b":1}）
str = ("In a peaceful forest clearing surrounded"
       " by towering evergreens and vibrant wildflowers, wildlife thrives in its natural habitat. Birds flit from branch to branch singing "
       "melodies that blend harmoniously with rustling leaves and flowing creeks nearby. The air is crisp and clean after morning rain showers, "
       "filled with earthy scents mixed with blooming flowers. "
       "This serene environment offers a tranquil escape for visitors seeking solace amidst the beauty of untouched wilderness.").lower()
myDick = {}
print(type(str))
for i in str:
    myDick[i] = 0
for i in str:
    if myDick[i] == 0:
        myDick[i] = 1
    else:
        myDick[i] += 1
print(myDick)